Footnote

Pizza Problem of the Week
9-13 December 1996 (Week 50)

The awkwardness in the coding of the Java solution given on the main problem page is the repetition of the terminiation condition: we specify both a (trivial) condition for the Enumerator and a condition for exiting the loop of the main program body. In fact, only the latter is nontrivial, and we can simplify the program by moving it into the enumerator itself. This alternate strategy seems more in keeping with the idea of an enumerator, which should ``know'' when it has no more input to give.

Why did we present the program in its original form? We wanted all of the aspects of the code which might reasonably vary from application to application to be a small area. The change from one style to the other is clearly superficial, and both are nicely abstracted by the techniques of the Pizza solution.


To the main problem text, Problems of the Week index, top-level Pizza page (text-only).
Comments and bug reports to the pizza group, pizza@ira.uka.de.
Page design & maintenance: John Maraist.
All software and documents on the Pizza site are © Copyright 1996 by the respective authors (as attributed on each; terms for redistribution are available). Java is a trademark of Sun Microsystems.